local shuangshen = fk.CreateSkill {
  name = "th_shuangshen",
  tags = { Skill.Switch }
}

shuangshen:addEffect(fk.CardUseFinished, {
  anim_type = "switch",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(shuangshen.name) and data.card and data.card.trueName == "slash" and #Card:getIdList(data.card) ~= 0
  end,
  on_cost = function(self, event, target, player, data)
    local name = player:getSwitchSkillState(shuangshen.name) == fk.SwitchYin and data.card.name or "duel"
    local room = player.room
    local dat = room:askToUseVirtualCard(player, {
      name = name,
      skill_name = shuangshen.name,
      prompt = "#th_shuangshen-use:::"..name,
      extra_data = {
        bypass_times = true
      },
      skip = true,
    })
    if dat then
      event:setCostData(self, dat)
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local use = event:getCostData(self)
    room:useCard(use)
  end,
})

Fk:loadTranslationTable{
  ["th_shuangshen"] = "双身",
  [":th_shuangshen"] = "转换技，当你使用非虚拟【杀】后，你可以视为使用一张：<br>"..
  "阳：【决斗】；<br>"..
  "阴：同种【杀】。",

  [":th_shuangshen_yang"] = "转换技，当你使用非虚拟【杀】后，你可以视为使用一张：<br>"..
  "<font color=\"#E0DB2F\">阳：【决斗】；</font><br>"..
  "阴：同种【杀】。",
  [":th_shuangshen_yin"] = "转换技，当你使用非虚拟【杀】后，你可以视为使用一张：<br>"..
  "阳：【决斗】；<br>"..
  "<font color=\"#E0DB2F\">阴：同种【杀】。</font>",

  ["#th_shuangshen-use"] = "双身：你可以视为使用一张%arg。",
}

return shuangshen